//
//  ViewController.m
//  MyBitMouse
//
//  Created by 高明阳 on 2021/3/11.
//

#import "ViewController.h"
#import "MyBitMouseView.h"
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height

@interface ViewController ()<MyBitMouseViewDelegate>
@property (nonatomic,strong)MyBitMouseView *bitMouseScene;
@property (nonatomic,strong)UILabel *scroeLbl;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self commonInit];
}
-(void)commonInit{
    self.title = @"打地鼠";
    [self addmySubViews];
    [self addMyContraints];
}
-(void)addmySubViews{
    [self.navigationController.navigationBar addSubview:self.scroeLbl];
    [self.view addSubview:self.bitMouseScene];
   
}
-(void)addMyContraints{
    self.scroeLbl.frame = CGRectMake(10, 10, 100, 30);
}
#pragma mark -- MyBitMouseViewDelegate
- (void)bitMouseScore:(NSUInteger)score{
        self.scroeLbl.text = [NSString stringWithFormat:@"%lu分",score];
}
#pragma mark -- lazy load
- (MyBitMouseView *)bitMouseScene{
    if (_bitMouseScene == nil) {
        _bitMouseScene  = [[MyBitMouseView alloc] initWithFrame:self.view.frame];
        _bitMouseScene.delegate = self;
    }
    return _bitMouseScene;
}
- (UILabel *)scroeLbl{
    if (_scroeLbl == nil) {
        _scroeLbl = [[UILabel alloc] init];
        _scroeLbl.font = [UIFont systemFontOfSize:13];
        _scroeLbl.textColor = [UIColor orangeColor];
    }
    return _scroeLbl;
}

@end
